import 'package:flutter_test/flutter_test.dart';
import 'package:demo_scan/demo_scan.dart';
import 'package:demo_scan/demo_scan_platform_interface.dart';
import 'package:demo_scan/demo_scan_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockDemoScanPlatform
    with MockPlatformInterfaceMixin
    implements DemoScanPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final DemoScanPlatform initialPlatform = DemoScanPlatform.instance;

  test('$MethodChannelDemoScan is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelDemoScan>());
  });

  test('getPlatformVersion', () async {
    DemoScan demoScanPlugin = DemoScan();
    MockDemoScanPlatform fakePlatform = MockDemoScanPlatform();
    DemoScanPlatform.instance = fakePlatform;

    expect(await demoScanPlugin.getPlatformVersion(), '42');
  });
}
